Skip to content

fix: postcss-calc will change the style#125

Merged
xiaoluoboding merged 1 commit intoxiaoluoboding:mainfrom
CandyACE:main
Jul 21, 2025
Merged

fix: postcss-calc will change the style#125
xiaoluoboding merged 1 commit intoxiaoluoboding:mainfrom
CandyACE:main

Conversation

@CandyACE
Copy link
Copy Markdown
Contributor

postcss会导致css中的一段内容发生变化,导致效果出错

之前 --> postcss 之后

--scale: var(--toasts-before) * 0.05 + 1;

scale(calc( -1 * calc(--scale)));  --> scale(calc(  var(--toasts-before) * 0.05 + 1 * -1));

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-sonner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 1:56pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 16, 2025

Open in StackBlitz

npm i https://pkg.pr.new/xiaoluoboding/vue-sonner@125

commit: f0d6add

@xiaoluoboding
Copy link
Copy Markdown
Owner

Could you please send screenshots of the incorrect effect and the expected correct effect?

Because I’m not sure what kind of style error this might cause.

@CandyACE
Copy link
Copy Markdown
Contributor Author

CandyACE commented Jun 30, 2025

2025-06-30.132217.mp4

He will cause the animation of the notification to flip over.I reduced the speed of the animation

@mtzrmzia
Copy link
Copy Markdown

mtzrmzia commented Jul 3, 2025

@CandyACE is this fix solves this issue #133 (comment) ?

@sadeghbarati
Copy link
Copy Markdown
Contributor

Hi, added some context here for lib author

cssnano-default-presets uses many plugins,
and one of them is postcssCalc, which causes this wrong effect in production environment

Also, Nuxt uses cssnano in the production environment

We may need to add a document for Nuxt and cssnano configuration like

export default defineNuxtConfig({
  postcss: {
    plugins: {
      cssnano: {
        preset: ['default', {
          // disable calc optimization
          calc: false,
        }],
      },
    }
  },
})

@CandyACE
Copy link
Copy Markdown
Contributor Author

@CandyACE is this fix solves this issue #133 (comment) ?

It seems to be the same problem. This fix should have resolved it.

@xiaoluoboding xiaoluoboding merged commit 4491642 into xiaoluoboding:main Jul 21, 2025
4 checks passed
@mtzrmzia
Copy link
Copy Markdown

@CandyACE is this fix solves this issue #133 (comment) ?

It seems to be the same problem. This fix should have resolved it.

@CandyACE @xiaoluoboding I just updated to version 2.0.2, and the issue persists. So this change doesn't fix it.

@CandyACE
Copy link
Copy Markdown
Contributor Author

CandyACE commented Aug 1, 2025

@CandyACE is this fix solves this issue #133 (comment) ?

It seems to be the same problem. This fix should have resolved it.

@CandyACE @xiaoluoboding I just updated to version 2.0.2, and the issue persists. So this change doesn't fix it.

I will try it again

@CandyACE
Copy link
Copy Markdown
Contributor Author

CandyACE commented Aug 1, 2025

@CandyACE is this fix solves this issue #133 (comment) ?

It seems to be the same problem. This fix should have resolved it.

@CandyACE @xiaoluoboding I just updated to version 2.0.2, and the issue persists. So this change doesn't fix it.

I've checked, and the 2.0.2 version doesn't include this fix of mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants